<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

{/*    <div class="form-group">*/}
{/*        <label class="control-label col-xs-12 col-sm-2">{:__('Category')&cc;:</label>*/}
{/*        <div class="col-xs-12 col-sm-8">*/}
{/*            {:build_radios('row[category]', ['1'=>'多券', '2'=>'单券'],$row['category'])&cc;*/}
{/*        </div>*/}
{/*    </div>*/}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Banner')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-banner" data-rule="required" class="form-control" size="50" name="row[banner]" type="text" value="{$row.banner|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-banner" class="btn btn-danger faupload" data-input-id="c-banner" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-banner"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-banner" class="btn btn-primary fachoose" data-input-id="c-banner" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-banner"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-banner"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Form_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-form_id" data-rule="" data-source="form/index" class="form-control selectpage" name="row[form_id]" type="text" value="{$row.form_id|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[type]', ['1'=>'立减金', '2'=>'转账零钱'],$row['type'])}
        </div>
    </div>
    <div class="form-group row">
        <label class="control-label col-xs-12 col-sm-2">设置:</label>
        <div class="col-xs-12 col-sm-8">
            <table class="table fieldlist" data-template="eventtpl" data-name="row[coupon_form]" id="second-table">
                <tr>
                    <td style="position: absolute;left: -9999px;top: -9999px;">{:__('id')}</td>
                    <td>{:__('名称')}</td>
                    <td class="batch_no">{:__('批次号')}</td>
                    <td class="pay_money">{:__('门槛')}</td>
                    <td>{:__('活动金额')}</td>
                    <td>{:__('创建数量')}</td>
                    <td>{:__('截止时间')}</td>
                    <td width="100"></td>
                </tr>
                <tr>
                    <td colspan="4"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></td>
                </tr>
            </table>

            <!--请注意实际开发中textarea应该添加个hidden进行隐藏-->
            <textarea name="row[coupon_form]" style="display: none;" cols="30" rows="5">{$row.coupon_form}</textarea>
            <script id="eventtpl" type="text/html">
                <tr class="form-inline">
                    <td><input type="number" name="<%=name%>[<%=index%>][id]" class="form-control" style="position: absolute;left: -9999px;top: -9999px;" value="<%=row.id%>"/></td>
                    <td><input type="text" name="<%=name%>[<%=index%>][name]" class="form-control"  value="<%=row.name%>"/></td>
                    <td class="batch_no"><input type="text" name="<%=name%>[<%=index%>][batch_no]" class="form-control"  value="<%=row.batch_no%>"/></td>
                    <td class="pay_money"><input type="number" name="<%=name%>[<%=index%>][pay_money]" class="form-control" style="width: 100px" value="<%=row.pay_money%>"/></td>
                    <td><input type="number" name="<%=name%>[<%=index%>][discounts_money]" class="form-control" style="width: 100px" value="<%=row.discounts_money%>"/></td>
                    <td><input type="number" name="<%=name%>[<%=index%>][number]" class="form-control" style="width: 100px" value="<%=row.number%>"/></td>
                    <td><input type="text" name="<%=name%>[<%=index%>][end_data]" class="form-control" value="<%=row.end_data%>"/></td>
                    <td>
                        <!--下面的两个按钮务必保留-->
                        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                        <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                    </td>
                </tr>
            </script>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[status]', ['1'=>'启用', '2'=>'禁用'], $row['status'])}
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>
<script>
    var type = {$row['type']};
</script>